Repository navigation
Fix crash when re-entering exhausted generator after earlier sections - #3237
Open
akasakariko wants to merge 1 commit into
Open
akasakariko wants to merge 1 commit into
akasakariko wants to merge 1 commit into
Conversation
When preceding sections take more cycles than a following GENERATE has elements, GeneratorTracker completes and exhausts its underlying generator before all sibling sections finish. Re-entering GENERATE in a later cycle then dereferences the exhausted generator. Track exhaustion on GeneratorTracker, reset the underlying generator on re-entry while keeping CompletedSuccessfully, and handle nested generators created under an already completed tracker. Closes catchorg#2809
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## devel #3237 +/- ##
==========================================
- Coverage 91.41% 91.30% -0.11%
==========================================
Files 205 205
Lines 9106 9139 +33
==========================================
+ Hits 8324 8344 +20
- Misses 782 795 +13 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When earlier
SECTIONblocks take more test cycles than a followingGENERATEhas elements,GeneratorTrackerfinishes advancing and exhausts its underlyingIGeneratorbefore those sections finish runningIn a later cycle, execution reaches
GENERATEagain whileGeneratorTracker::isComplete()is true, andCatch::Generators::generatedereferences the exhausted generator viaget(), causing out-of-bounds access and a fatal errorThis change:
m_isExhaustedonGeneratorTrackerwhencountedNext()returnsfalseRunContext::createGeneratorTrackerwhile keeping the tracker inCompletedSuccessfullyand updating the current tracker so nestedGENERATEcalls remain alignedGeneratorTrackerinCompletedSuccessfullywithout reopening the parent trackerGitHub Issues
Closes #2809